<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Insert title here</title>
	<script type="text/javascript">
		function validateEmailIsExists(){
			var email = document.getElementById('email').value;
			$.ajax({
				url:'ValidateEmailIsExistsServlet',/* 请求的url */
				type:'post',		/* 发送请求的方式  */
				data:{email:email},	/* 发送数据必须是对象 */
				success:function(data){
					console.log(data);
					var p = JSON.parse(data);
					console.log(p[0].id);
					//$('#emailTips').html(result.email);
				},
			});
		}
		
	</script>
</head>
<body>
	<form action="RegisterServlet" method="post">
		邮箱：<input id="email" type="text" name="email" onblur="validateEmailIsExists()"><span id="emailTips"></span><br>
		密码：<input type="password" name="pass"><span id="passTips"></span><br>
		<input type="submit" value="注册">
	</form>
		
	<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
</body>
</html>